﻿//using Kele.Repository;
//using Kele.Activity.Domain.Interfaces;
//using Microsoft.Extensions.Configuration;
//using System.Linq;
//using System.Reflection;
//using System.Runtime.Versioning;

//namespace Kele.Activity.Application.Service
//{
//    public class SettingsManager : ISettingsManager
//    {
//        private readonly IConfiguration _config;

//        public SettingsManager(IConfiguration config, string contentRootPath, string webRootPath, Assembly entryAssembly)
//        {
//            _config = config;
//            ContentRootPath = contentRootPath;
//            WebRootPath = webRootPath;

//            if (entryAssembly != null)
//            {
//                Version = entryAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
//                    .InformationalVersion;

//                if (entryAssembly
//                    .GetCustomAttributes(typeof(TargetFrameworkAttribute), false)
//                    .SingleOrDefault() is TargetFrameworkAttribute targetFrameworkAttribute)
//                {
//                    TargetFramework = targetFrameworkAttribute.FrameworkName;
//                }
//            }
//        }

//        public string ContentRootPath { get; }
//        public string WebRootPath { get; }
//        public string Version { get; }
//        public string TargetFramework { get; }
//        public bool IsNightlyUpdate => _config.GetValue(nameof(IsNightlyUpdate), false);
//        public bool IsProtectData => _config.GetValue(nameof(IsProtectData), false);
//        public string SecurityKey => _config.GetValue<string>(nameof(SecurityKey));

//        public string DatabaseConnectionString => _config.GetValue<string>("Database:ConnectionString");
//        public IDatabase Database => new Database(DatabaseConnectionString);
      



//    }
//}
